package com.lzg;

/**
 * @Author lizhigang Date: 2019/9/12 14:51
 * @description:简单功能模式创建支付对象
 */
public class PaymentFactory {

	public static Payment getPayment(String type) {
		switch (type) {
			case "CREDIT":
				return new CreditCardPayment();
			case "DEBIT":
				return new DebitCardPayment();
				default:
					return new CreditCardPayment();
		}

	}
}
